<template>
  <div id="app">
    <router-view  />
    <!-- <lay-out v-else></lay-out> -->

  </div>
</template>

<script>
  import {getCookie} from './components/until/index'

export default {
  name: 'App',
  data(){
    return {
      userid:true
    }
  },
  created () { //组件创建后，数据已经完成 初始化 但dom还未生成

    if( getCookie('userid')){
      
      if(this.$route.path == '/index' || this.$route.path == '/admin'){
        this.$router.push({
          path:'/admin'
        })
      }
      
    }else{
      
      if(this.$route.path == '/index' || this.$route.path == '/'){
        
        this.$router.push({
          path:'/index'
        })
      }
    }
  }
}
</script>

<style>

body{
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  
}
#app {
  font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
</style>
